import request from '@/utils/request'

// 查询生产工单--外购列表
export function listPurchase(query) {
  return request({
    url: '/pro/purchase/list', method: 'get', params: query
  })
}

// 查询生产工单--外购详细
export function getPurchase(workorderId) {
  return request({
    url: '/pro/purchase/' + workorderId, method: 'get'
  })
}

// 新增生产工单--外购
export function addPurchase(data) {
  return request({
    url: '/pro/purchase', method: 'post', data: data
  })
}

// 修改生产工单--外购
export function updatePurchase(data) {
  return request({
    url: '/pro/purchase', method: 'put', data: data
  })
}

// 删除生产工单--外购
export function delPurchase(workorderId) {
  return request({
    url: '/pro/purchase/' + workorderId, method: 'delete'
  })
}
